package com.hn.service.Impl;

import com.hn.dao.UserDao;
import com.hn.pojo.User;
import com.hn.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @作者 : wangchangdian
 * @创建时间 : 2019/3/22 - 9:20
 */
@Service("userService")
public class UserServiceImpl implements UserService {
    //@Autowired
    @Resource
    private UserDao userDao;

    @Override
    public List<User> findNameByUser(String userName) {
        return userDao.findNameByUser(userName);
    }

    //根据id或userName删除用户
    @Override
    public void deleteUserById(String userName,int id) {
        userDao.deleteUserById(userName,id);
    }

    //增加用户
    @Override
    public void addUser(User user) {
        userDao.addUser(user);
    }

    @Override
    public void updateUser(User user) {
        userDao.updateUser(user);
    }

    @Override
    public User findOneByIdUser(int id) {
        return userDao.findOneByIdUser(id);
    }

}
